package com.leetcode.August;

import javax.swing.tree.TreeNode;

/**
 * @Description: 100. 相同的树
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-26 10:13
 */
public class LC100相同的树 {
    public boolean isSameTree(TreeNode p, TreeNode q) {
        if (p == null || q == null) {
            return p == null && q == null;
        }
        if (p.val == q.val) {
            return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
        }
        return false;
    }
}
